package com.gome.han.springcloud.api.service;

import com.gome.han.springcloud.api.bean.User;

import feign.hystrix.FallbackFactory;

/**
* @author hanpeng
* @version 创建时间：2020年8月9日 上午11:25:30
* @ClassName 类名称
* @Description 类描述
*/

public class UserServiceFactory implements FallbackFactory<UserService>{

	@Override
	public UserService create(Throwable cause) {
		UserService userService = new UserService() {
			
			@Override
			public User getUser(Integer age) {
				User user = new User("降级", age);
				return user;
			}
		};
		return userService;
	}

}
